package com.lsa.letcode.the140.wordBreakII;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.HashSet;

import org.junit.Test;

import com.lsa.letcode.common.LetCodeTestBase;

public class WordBreakIITest extends LetCodeTestBase {
	@Test
	public void test() throws Exception {
		Solution s = new Solution();
		assertEquals(Arrays.asList("a"),
				s.wordBreak(
						"a",
						new HashSet<>(Arrays.asList("a"))));
		
		assertEquals(Arrays.asList("cats and dog", "cat sand dog"),
				s.wordBreak(
						"catsanddog",
						new HashSet<>(Arrays.asList("cat", "cats", "and",
								"sand", "dog"))));
		
		
		assertEquals(Arrays.asList("big brown fox jumpso ver the lazy dog",
				"big brown fox jumpso ver the laz ydog",
				"big brown fox jumps over the lazy dog",
				"big brown fox jumps over the laz ydog"), s.wordBreak(
				"bigbrownfoxjumpsoverthelazydog",
				new HashSet<>(Arrays.asList("big", "brown", "fox", "jumps",
						"over", "jumpso", "laz", "ydog", "ver", "the", "lazy", "dog"))));
	}
}
